{% extends "base.html" %}
{% block title %}{{ "调整" if type!="hand" }}预约成功{% endblock %}
{% block head %}
    {{ super() }}
    <style>
        h2 {
            align-items: center;
            justify-content: center;
            padding: 15px;
        }

        img {
            margin-right: 5px;
        }
    </style>
{% endblock %}
{% block body %}
    <div class="contianer info-page" style="display: flex;flex-direction: column;">
        <div class="weui-well text-center">
            <h2 class="weui-flex"><img src="/static/images/success.png">
                {{ "调整" if type!="hand" }}预约成功！
            </h2>
            <div style="padding: 10px;">请根据预约时间提前到医院分诊台或自助机进行报到</div>
        </div>
        {% if exam %}
            <div class="weui-well">
                <div class="font12">
                    <div class="weui-flex resResult">
                        <div class="weui-flex">
                            <img style="width: 1.6em;height: 1.6em;"
                                 src="/static/images/success.png">
                            <div>
                                {% for ex in exam["ExamList"] %}
                                    <div>{{ ex["bodyPart_second"] }}</div>
                                {% endfor %}
                            </div>
                        </div>
                        <div class="weui-flex__item" style="text-align: right">预约时间：<span
                                class="text-red">{{ exam["ReservationDateTime"] }}</span></div>
                    </div>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}
{% block script %}
    {{ super() }}
    <script type="text/javascript">
        $(function () {
            pushHistory();
            var bool = false;
            setTimeout(function () {
                bool = true;
            }, 1500);
            window.addEventListener("popstate", function (e) {
                if (bool) {
                    window.location.href = navRoot;
                }
                pushHistory();

            }, false);

            function pushHistory() {
                var state = {
                    title: "success",
                    url: ""
                };
                window.history.pushState(state, "success", "");
            }
        })
    </script>
{% endblock %}